package jy.game.components.wuxue.box;


import android.text.TextUtils;

import jy.game.components.wuxue.JyBuff;
import jy.game.components.wuxue.JyTrigger;
import jy.game.components.wuxue.SkillCoverType;
import jy.game.components.wuxue.SkillType0;
import jy.game.components.wuxue.pojo.JyUniqueSkill;

public class UniqueSkillInstance extends JySkillBox {

    public JySkillBox    _parent;
    public JyUniqueSkill _skill;


//    public UniqueSkillInstance(JyUniqueSkill skill, JySkillBox parent) {
//        owner = parent.owner;
//        this._parent = parent;
//        this._skill = skill;
//    }


    // (get) Token: 0x0600052F RID: 1327 RVA: 0x00004C5C File Offset: 0x00002E5C
//    public /*override*/ Color Color() {
//        {
//            return Color.red;
//        }
//    }

    // (get) Token: 0x0600052D RID: 1325 RVA: 0x00004C42 File Offset: 0x00002E42
    public /*override*/ String Name() {
        {
            return this._skill.name;
        }
    }

    // (get) Token: 0x0600052E RID: 1326 RVA: 0x00004C4F File Offset: 0x00002E4F
    public /*override*/ String Icon() {
        {
            return this._parent.Icon;
        }
    }

    // (get) Token: 0x06000530 RID: 1328 RVA: 0x00004C63 File Offset: 0x00002E63
    public /*override*/ int Cd() {
        {
            return this.UniqueSkill().castCd;
        }
    }

    // (get) Token: 0x06000531 RID: 1329 RVA: 0x00004C70 File Offset: 0x00002E70
    public /*override*/ int Type() {
        {
            return this._parent.Type;
        }
    }

    // (get) Token: 0x06000532 RID: 1330 RVA: 0x00004C7D File Offset: 0x00002E7D
    public /*override*/ int CostMp() {
        {
            return this._parent.costMp;
        }
    }

    // (get) Token: 0x06000533 RID: 1331 RVA: 0x00004C8A File Offset: 0x00002E8A
    public /*override*/ int CostBall() {
        {
            return this.UniqueSkill().costBall;
        }
    }

    // (get) Token: 0x06000534 RID: 1332 RVA: 0x00004C97 File Offset: 0x00002E97
    public /*override*/ int CastSize() {
        {
            return this.UniqueSkill().castSize;
        }
    }

    // (get) Token: 0x06000535 RID: 1333 RVA: 0x00004CA4 File Offset: 0x00002EA4
    public /*override*/ int Size() {
        {
            return this.UniqueSkill().coverSize;
        }
    }

    // (get) Token: 0x06000536 RID: 1334 RVA: 0x00004CB1 File Offset: 0x00002EB1
    public /*override*/ SkillCoverType CoverType() {
        {
            return SkillCoverType.build(this.UniqueSkill().coverType);
        }
    }

    // (get) Token: 0x06000537 RID: 1335 RVA: 0x00004CBE File Offset: 0x00002EBE
    public /*override*/ String Animation() {
        {
            return this.UniqueSkill().animation;
        }
    }

    // (get) Token: 0x06000538 RID: 1336 RVA: 0x00004CCB File Offset: 0x00002ECB
    public /*override*/ SkillType0 SkillType() {
        {
            return SkillType0.Unique;
        }
    }

    // (get) Token: 0x06000539 RID: 1337 RVA: 0x00004CCE File Offset: 0x00002ECE
    @Override public /*override*/ int level() {
        {
            return this._parent.level();
        }
    }

    // (get) Token: 0x0600053A RID: 1338 RVA: 0x00004CDB File Offset: 0x00002EDB
    @Override public /*override*/ double suit() {
        {
            return this._parent.suit();
        }
    }

    // (get) Token: 0x0600053B RID: 1339 RVA: 0x00032FA4 File Offset: 0x000311A4
    @Override public /*override*/ double power() {
        {
            int num = 0;
            if (owner != null) {
                for (JyTrigger trigger : owner.GetTriggers("powerup_uniqueskill")) {
                    if (trigger.Argvs()[0] == this.Name) {
                        num += Integer.parseInt(trigger.Argvs()[1]);
                    }
                }
            }
            return (double) ((this._parent.power() + this.UniqueSkill().powerAdd) * (1.0 + (double) num / 100.0));
        }
    }

    // (get) Token: 0x0600053C RID: 1340 RVA: 0x00004CE8 File Offset: 0x00002EE8
    @Override public /*override*/ String audio() {
        {
            if (!TextUtils.isEmpty(this.UniqueSkill().audio)) {
                return this.UniqueSkill().audio;
            }
            return this._parent.audio();
        }
    }

    // (get) Token: 0x0600053D RID: 1341 RVA: 0x0003306C File Offset: 0x0003126C
    //[XmlIgnore]
    @Override protected /*override*/ String getDescriptionInRichtext(boolean forAchievement) {
        String str = "";
        str += String.format("<color='white'>所属武学</color> <color='red'>%s</color>\n", this._parent.Name);
        str += String.format("<color='white'>绝技解锁等级</color> <color='red'>%s</color>\n\n", this.RequireLevel());
        str = str + this.UniqueSkill().info + "\n";
        double num = this.UniqueSkill().powerAdd + this._parent.power();
        str += String.format("<color='red'>威力 %s</color>\n", num);
        str += String.format("<color='black'>覆盖类型 %s</color>\n", getSkillCoverTypeChinese());
        str += String.format("<color='black'>覆盖范围 %s</color>\n", this.size);
        str += String.format("<color='black'>施展范围 %s</color>\n", this.castSize);
        str += String.format("<color='cyan'>消耗内力 %s</color>\n", this.costMp);
        str += String.format("<color='yellow'>消耗怒气 %s</color>\n", this.CostBall);
        if (this.currentCd == 0) {
            str += String.format("<color='green'>技能CD %s/%s</color>\n", this.currentCd, this.Cd);
        } else {
            str += String.format("<color='red'>技能CD %s/%s</color>\n", this.currentCd, this.Cd);
        }
        return str + getBuffsString();

    }

    @Override public /*override*/ boolean tryAddExp(int exp, int maxLevel) {
        return this._parent.tryAddExp(exp, maxLevel);
    }

    // (get) Token: 0x0600053F RID: 1343 RVA: 0x00004D24 File Offset: 0x00002F24
    //[XmlIgnore]
    @Override public /*override*/ Iterable<JyBuff> getBuffs() {
        return this.UniqueSkill().getBuffs();

    }

    // (get) Token: 0x06000540 RID: 1344 RVA: 0x00004D31 File Offset: 0x00002F31
    @Override public /*override*/ boolean tiaohe() {
        return this._parent.tiaohe();

    }

    // (get) Token: 0x06000541 RID: 1345 RVA: 0x00004D3E File Offset: 0x00002F3E
    public JyUniqueSkill UniqueSkill() {
        {
            return this._skill;
        }
    }

    // (get) Token: 0x06000542 RID: 1346 RVA: 0x00004D46 File Offset: 0x00002F46
    //[XmlIgnore]
    public int RequireLevel() {
        {
            return this.UniqueSkill().requireLevel;
        }
    }
}
